/**
 * 功能描述 导航栏
 */

define(function (require, exports, module) {
	var Subnav = require("subnav");
	var events = require("../handler/events");
	var user = require("store").get("user");

	
    var instance = {
        initComponent:function (params,widget){
        	var subnav=new Subnav({
        		parentNode:".J-subnav",
        		model:{
            		title:"营业日报",
            		items:[{
						id : "servicePoint",
						type:"buttongroup",
						tip:"服务点",
//						url:"api/servicepoint/operableservicepoints",
//						lazy:true,
						items:user.privateServicePoints,
						keyField:"pkServicePoint",
						valueField:"name",
					    params : function(){
							return {
								fetchProperties:"pkServicePoint,name"
							};
						},
						handler : function(key,element){
							events.setData(widget);
						}
					},{
						id:"date",
					      type:"date",
					      tip:"统计时间",
					      handler: function(){
					    	  events.setData(widget);
					      }
            		}]
        		}
        	});
        	widget.set("subnav",subnav);

        }
    };
    module.exports = instance;
});
